Assertions
For docs/details, see src/Tester/Assertions.php
isInstanceOf($object, $shouldBe)
is_object($object)
is_false($value)
is_true($value)
str_contains($str, $target, ...$strings)
str_not_contains(string $str, $target, ...$strings)
compare($target, $actual,$strict=false)
compare_raw($target, $actual, $strict=false)
compare_arrays($target, $actual, $strict=false)
compare_objects($target, $actual, $strict=false)
compare_json($target, $actual, $strict=false)
str_contains_lines($str, $target)
compare_lines($target, $actual)
compare_dump($target, $actual)
There is also a magic __call()
which will invoke an existing PHP function and use it's return value as an assertion.
For example, $this->in_array('value', $array_to_test);
will pass
if PHP's in_array()
method returns true